package com.ysd.lis.controller.bac;


import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.bac.BacDrugTestResult;
import com.ysd.lis.request.bac.BacDrugResTempQuickInsertRequest;
import com.ysd.lis.service.bac.BacDrugTestResultService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author cfz
 * @since 2024-03-21
 */
@RestController
@RequestMapping("/api/bac/bac-drug-test-result")
public class BacDrugTestResultController extends BaseController {
    @Autowired
    BacDrugTestResultService bacTestResultService;

    @ApiOperation("查询")
    @GetMapping("/findBacDrugTestResultList")
    public Result findBacDrugTestResultList(BacDrugTestResult bacTestResult) {
        return bacTestResultService.findBacDrugTestResultList(bacTestResult);
    }

    @ApiOperation("增加")
    @PostMapping("/addBacDrugTestResult")
    public Result addBacDrugTestResult(@RequestBody BacDrugTestResult bacTestResult) {
        return bacTestResultService.addBacDrugTestResult(bacTestResult);
    }

    @ApiOperation("删除")
    @PostMapping("/deleteBacDrugTestResult")
    public Result deleteBacDrugTestResult(@RequestBody BacDrugTestResult bacTestResult) {
        return bacTestResultService.deleteBacDrugTestResult(bacTestResult);
    }

    @ApiOperation("批量删除")
    @PostMapping("/batchDeleteBacDrugTestResult")
    public Result batchDeleteBacDrugTestResult(@RequestBody List<BacDrugTestResult> bacDrugTestResults) {
        return bacTestResultService.batchDeleteBacDrugTestResult(bacDrugTestResults);
    }

    @ApiOperation("修改")
    @PostMapping("/updateBacDrugTestResult")
    public Result updateBacDrugTestResult(@RequestBody BacDrugTestResult bacTestResult) {
        return bacTestResultService.updateBacDrugTestResult(bacTestResult);
    }

    @ApiOperation("药敏模板批量快速输入")
    @PostMapping("/drugResultTemplateQuickInsert")
    public Result drugResultTemplateQuickInsert(@RequestBody BacDrugResTempQuickInsertRequest input) {
        return bacTestResultService.drugResultTemplateQuickInsert(input);
    }

    @ApiOperation("设置药敏是否报告")
    @PostMapping("/drugTestResultIsReportChange")
    public Result drugTestResultIsReportChange(@RequestBody BacDrugTestResult bacTestResult) {
        return bacTestResultService.drugTestResultIsReportChange(bacTestResult);
    }
}
